home *** CD-ROM | disk | FTP | other *** search
- /* Pictoid WDEF
-
- © 1990, 1991, 1992 by Nigel Perry
-
- This WDEF makes a window from a picture, which must be passed as a
- PicHandle as the refCon parameter to the NewWindow() call. By default
- the window will be the same shape as the picture, and may consist
- of a number on non-contiguous areas - a mask is created
- from the picture by "lasso"ing it. A variation code allows a user
- supplied mask - in which case the window may have holes in it…
-
- This WDEF requires the BitMapToRegion trap. This currently only
- exists in 32CQD systems, a version of it is included in this package
- for those of you without colour.
-
- Dr Nigel Perry
- Department of Computer Science
- Massey University
- Palmerston North
- New Zealand
-
- N.Perry@massey.ac.nz
- */
-
- #ifndef _PICTOID
- #define _PICTOID
-
- #define PictWDEF (16 * 16)
-
- /* variation codes - or together with PictWDEF */
- /* primary */
- #define PW_Lasso 4
- #define PW_Mask 0
- #define PW_PicMask 8
- #define PW_PicWind 12
- /* secondary */
- #define PW_SizeWind 2
- #define PW_AddFrame 1
-
- /* for low-level hackers… */
- #define PW_UserMask 8
- #define PW_CalcMask 4
-
- /* allocated by WDEF Globals.c and kept by Gestalt() */
- typedef struct
- { PicHandle pic, frame;
- struct
- { Boolean clonePic:1; /* T => clone pic and dispose on close
- F => copy handle, dispose as per sharePic */
- Boolean sharePic:1; /* T => don't dispose on close
- F => DetachResource() on open,
- dispose on close */
- Boolean cloneFrame:1;
- Boolean shareFrame:1;
- Boolean spare:4;
- } flags;
- char spare1;
- int spare2;
- /* following fields used by Pictoid XCMD - DO NOT TOUCH */
- long private[3];
- short private2;
- } WDEFGlobals, *WDEFGlobalsPtr, **WDEFGlobalsHand;
-
- OSErr GetWDEFGlobals(Boolean, WDEFGlobals **);
-
- /* allocated by WDEF, first three fields private to WDEF, rest set to zero */
- typedef struct
- { PicHandle pic, frame;
- struct
- { Boolean disposePic:1;
- Boolean disposeFrame:1;
- Boolean unused:6;
- char unused2;
- int unused3;
- } flags;
- /* following fields used by Pictoid XCMD - DO NOT TOUCH */
- long private[13];
- } WDEFPrivate, *WDEFPrivatePtr, **WDEFPrivateHand;
-
- #endif